var r1 = document.getElementById("r1");
var r2 = document.getElementById("r2");
var r3 = document.getElementById("r3");
var r4 = document.getElementById("r4");
r1.onclick = function(){
    r1.style.backgroundColor = "blue";
    r1.style.color = "#fff";
    r2.style.backgroundColor = "#f6f6f6";
    r2.style.color = "#a5a5a5";
    r3.style.backgroundColor = "#f6f6f6";
    r3.style.color = "#a5a5a5";
    r4.style.backgroundColor = "#f6f6f6";
    r4.style.color = "#a5a5a5";
}
r2.onclick = function(){
    r2.style.backgroundColor = "blue";
    r2.style.color = "#fff";
    r1.style.backgroundColor = "#f6f6f6";
    r1.style.color = "#a5a5a5";
    r3.style.backgroundColor = "#f6f6f6";
    r3.style.color = "#a5a5a5";
    r4.style.backgroundColor = "#f6f6f6";
    r4.style.color = "#a5a5a5";
}
r3.onclick = function(){
    r3.style.backgroundColor = "blue";
    r3.style.color = "#fff";
    r1.style.backgroundColor = "#f6f6f6";
    r1.style.color = "#a5a5a5";
    r2.style.backgroundColor = "#f6f6f6";
    r2.style.color = "#a5a5a5";
    r4.style.backgroundColor = "#f6f6f6";
    r4.style.color = "#a5a5a5";
}
r4.onclick = function(){
    r4.style.backgroundColor = "blue";
    r4.style.color = "#fff";
    r1.style.backgroundColor = "#f6f6f6";
    r1.style.color = "#a5a5a5";
    r2.style.backgroundColor = "#f6f6f6";
    r2.style.color = "#a5a5a5";
    r3.style.backgroundColor = "#f6f6f6";
    r3.style.color = "#a5a5a5";
}